package com.jiangyao.common.configs;

import org.dozer.DozerBeanMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;

@Configuration
public class DozerConfig {

    @Bean
    public DozerBeanMapper mapper() {
        ArrayList<String> mappingFileUrls = new ArrayList<>();
        mappingFileUrls.add("dozer-custom-convert.xml");
//        DozerBeanMapper mapper = getSingletonDozerBeanMapper();
//        mapper.setMappingFiles(mappingFileUrls);
//        return mapper;
        //return new DozerBeanMapper();
        DozerBeanMapper dozerBeanMapper = new DozerBeanMapper();
        dozerBeanMapper.setMappingFiles(mappingFileUrls);
        return dozerBeanMapper;
    }

}
